package com.bytedance.scenedemo.group.placeholder;

import com.bytedance.scene.Scene;
import ohos.aafwk.content.Intent;
import ohos.agp.colors.RgbColor;
import ohos.agp.components.Component;
import ohos.agp.components.ComponentContainer;
import ohos.agp.components.LayoutScatter;
import ohos.agp.components.Text;
import ohos.agp.components.element.ShapeElement;
import ohos.agp.utils.TextAlignment;

public class PlaceHolderViewSampleChildScene extends Scene {
    @Override
    public Component onCreateView(LayoutScatter scatter, ComponentContainer container, Intent intent) {
        Text text = new Text(requireApplicationContext());
        text.setText(PlaceHolderViewSampleChildScene.class.getName());
        text.setTextAlignment(TextAlignment.CENTER);
        text.setTextSize(12, Text.TextSizeType.FP);
        text.setMultipleLine(true);
        return text;
    }

    @Override
    public void onViewCreated(Component component, Intent intent) {
        super.onViewCreated(component, intent);
            ShapeElement shapeElement = new ShapeElement();
            shapeElement.setRgbColor(RgbColor.fromArgbInt(0xFFF36D60));
            getView().setBackground(shapeElement);
    }

}
